package com.senseilearning.sensei;

import java.util.ArrayList;

public class Chapters{
	private static ArrayList<Chapter> chapters = new ArrayList<Chapter>();
	private static String name;	
	private static boolean hasData;
	
	public static void addChapter(Chapter chapter){
		hasData = true;
		chapters.add(chapter);
	}
	
	public static void setName(String name){
		Chapters.name = name;
	}
	
	public static String getName(){ 
		return name;
	}
	
	public static Section getSection(int chapter, int section){
		return chapters.get(chapter).get(section);
	}

	public static ArrayList<String> getChapterNames() {
		ArrayList<String> names = new ArrayList<String>();
		for(int i=0;i<chapters.size();i++){
			names.add(chapters.get(i).getName());
		}
		return names;
	}

	public static ArrayList<String> getSectionNames(int section) {
		return chapters.get(section).getNames();
	}
	
	public static int numberOfChapters(){
		return chapters.size();
	}
	
	public static int numberOfSections(int chapter){
		return chapters.get(chapter).size();
	}
	
	public static boolean hasData(){
		return hasData;
	}
		
}